package com.labichaoka.chaoka.ui.home.fragment.my.record;

import com.labichaoka.chaoka.entity.WithdrawRecordInfoResponse;

public class WithdrawRecordPresenterImpl implements WithDrawRecordPresenter,WithdrawRecordInteractor.OnFinishedListener {
    private WithDrawRecordView view;
    private WithdrawRecordInteractor interactor;

    public WithdrawRecordPresenterImpl(WithDrawRecordView view, WithdrawRecordInteractor interactor) {
        this.view = view;
        this.interactor = interactor;
    }

    @Override
    public void getWithdrawRecordInfo() {
        if (view!=null){
            view.showProgress();
        }
        interactor.getWithdrawRecordInfo(this);

    }

    @Override
    public void onDestroy() {
        view=null;
    }

    @Override
    public void onSuccess(WithdrawRecordInfoResponse response) {
        view.hideProgress();
        view.getWithdrawRecordInfoCallback(response);
    }

    @Override
    public void onFailed() {
        view.hideProgress();
    }
}
